-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sock-utils]: Add initial support for socket helpers #671
Conversation
c99baac
to
743a643
Compare
8213d5f
to
8e3ebb9
Compare
struct ifaddrs { | ||
struct ifaddrs *ifa_next; /* Next item in list */ | ||
char *ifa_name; /* Name of interface */ | ||
struct sockaddr *ifa_addr; /* Address of interface */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the ifa_data - address-family- specific data
in spite that support for other family is not implemented? It is better to keep it for compatibility reason with linux API and set it to NULL. Consider to add other fields for the same reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep the structure minimal, to contain only the fields which are supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll reconsider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left the structure definition in the original shape, to keep it minimal.
Name of the component is misleading, consider:
|
Document how and where are the prototypes defined |
Add to the IDF hints -- if we get pipe() linkage error -> please install sock-utils (or whatever w'll call it) |
*/ | ||
#pragma once | ||
|
||
#ifndef NI_NUMERICHOST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Can the 'NI_MAXHOST', 'NI_MAXSERV' be added here to specify the maximum sizes required for the buffers?
This will allow to avoid magic numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will use these number when allocating buffers in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used NI_MAXSERV
for buffer size in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately I had to revert this change to pass the CI.
This is defined in newlib headers in IDF, and newlib is not supported on linux target.
I can use some system header (which works on my machine), but wouldn't work on build machine.
4a89e8c
to
874b955
Compare
other ideas (since we have the linux target):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
0.1.0 Features - Add initial support for socket helpers (31f57ad)
874b955
to
6d94ad6
Compare
Supports:
ifaddrs()
esp_netif
internallysocketpair()
lwIP
loopback stream socketspipe()
socketpair()
getnameinfo()
lwIP
'sinet_ntop()
NI_NUMERICHOST
andNI_NUMERICSERV
flagsgai_strerror()
itoa
-like implementation